package com.example.myactspringboot.common;

import java.util.ArrayList;
import java.util.List;

/**
 * @Create 2023-09-23 16:19
 * @Description
 */
public class TreeNode {

    private String id;// 主键ID
    private String pid;// 父节点ID
    private Object content;// 节点内容
    private List<TreeNode> children = new ArrayList<TreeNode>();// 子孙节点

    public TreeNode(String id, String pid, Object content) {
        this.id = id;
        this.pid = pid;
        this.content = content;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public Object getContent() {
        return content;
    }
    public void setContent(Object content) {
        this.content = content;
    }
    public List<TreeNode> getChildren() {
        return children;
    }
    public void setChildren(List<TreeNode> children) {
        this.children = children;
    }
    @Override
    public String toString() {
        return "TreeNode [id=" + id + ", pid=" + pid + ", content=" + content
                + ", children=" + children + "]";
    }

}
